package com.d0326;





import java.util.Set;
import java.util.TreeSet;

public class TestTreeSet {
    public static void main(String[] args) {
        Set<Student> treeSet=new TreeSet<>();
        Student s1=new Student("zhangsan ",22,51);
        Student s2=new Student("lisi ",33,51);
        Student s3=new Student("wangwu ",12,51);
        Student s4=new Student("zhaoliu ",17,51);
        treeSet.add(s1);
        treeSet.add(s2);
        treeSet.add(s3);
        treeSet.add(s4);

        System.out.println("个数："+treeSet.size());
        for (Student i:
             treeSet) {
            System.out.println(i);
        }
    }
}
